package com.bcst.pojo;

/**
  分页请求体
 *@description 欢迎关注公众号 编程识堂,每日更新技术相关文章，关注我不迷路
 *@author 小堂
 *@create 2023/7/20 20:54
 */
public class PagingListBo {

    /**
     * 偏移量
     */
    private Integer offset=0;

    /**
     * 限量每页多少条（不填默认10
     */
    private Integer limit=10;

    /**
     * 总数量
     */
    private Integer totalCount=0;

    //总页数
    private Integer pageCount=0;

    /**
     * 页码当前多少页（不填默认1）
     */
    private Integer  pageIndex=1;

    public Integer getOffset() {
        offset = limit * (this.pageIndex-1);
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

    public Integer getPageCount() {
        pageCount= (this.totalCount + this.limit - 1) / this.limit;
        return pageCount;
    }

    public void setPageCount(Integer pageCount) {
        this.pageCount = pageCount;
    }

    public Integer getPageIndex() {
        return  pageIndex;
    }

    public void setPageIndex(Integer pageIndex) {
        this. pageIndex = pageIndex;
    }
}
